/**
 * name of package trade good is in
 */
package Model;

import java.io.Serializable;

/**
 * TradeGood class defines the goods players can buy and sell.
 * @author Ben
 * @version 1
 */
public class TradeGood implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -420293378593559575L;

	/**
	 * name of trade good
	 */
	private final String name; 
	
	/**
	 * attributes of trade good
	 */
	private final int category, id;
	
	/** represent some things */
	private int baseCost, quantity;
	
	/**TRADE GOODS (# represents category int)
	 * Category
	 * 1.       NATURAL RESOURCES 
	 *
	 *ID
	 * 1. Water - 30 to 54 credits
	 * 2. Furs - 250 to 320 credits
	 * 3. Food - 105 to 135 credits
	 * 4. Ore - 390 to 490 credits
	 *
	 *Category
	 * 2.       INDUSTRIAL GOODS
	 * 
	 * ID
	 * 5. Games - 180 to 240 credits
	 * 6. Firearms - 725 to 1175 credits
	 * 7. Medicine - 510 to 630 credits
	 * 8. Machines - 690 to 810 credits
	 * 9. Narcotics - 2625 to 3500 credits
	 * 10. Robots - 3950 to 4400 credits
	 */
	
	/**
	 * This method constructs all trade goods.
	 * @param name type of trade good
	 * @param id - id number for a type of trade good
	 * @param category category that trade good falls into
	 * @param baseCost a standard cost for a planet to manipulate for the trade good
	 * @param quantity - how much a TradeGood exists on a planet
	 */
	public TradeGood(String name, int id, int category, int baseCost, int quantity){
		this.name = name;
		this.category = category;
		this.baseCost = baseCost;
		this.id = id;
		this.quantity = quantity;
	}
	
	/**
	 * Returns the category of a trade good.
	 * @return int value corresponding to a given category for the trade good
	 */
	public int getCategory(){
		return category;
	}
	
	/**
	 * Returns the base cost of a given trade good. This base cost will be manipulated
	 * based on planet conditions.
	 * @return int value of base cost
	 */
	public int getBaseCost(){
		return baseCost;
	}
	
	/**
	 * Sets the final cost of an item. Used when the 
	 * price of an item needs to be adjusted based on dynamic scenarios.
	 * @param cost - the final cost
	 */
	public void setFinalCost(int cost){
		baseCost = cost;
	}
	
	/**
	 * Returns the name of a trade good.
	 * @return String name of trade good
	 */
	public String getName(){
		return name;
	}
	
	/**
	 * Returns the items id number.
	 * @return int item id
	 */
	public int getID(){
		return id;
	}
	
	/**
	 * Returns the quantity of a TradeGood.
	 * @return int quantity of a TradeGood
	 */
	public int getQuantity(){
		return quantity;
	}
	
	/**
	 * Sets the quantity of a good that exists in a planet's market.
	 * @param quantity the new quantity 
	 */
	public void setQuantity(int quantity){
		this.quantity = quantity;
	}
	
	/**
	 * to string method for trade good, returns name of trade good
	 * @return name of trade good 
	 */
	public String toString(){
		return name;
	}
}
